package com.wuyoucar.controller;

import com.wuyoucar.common.ResultBean;
import com.wuyoucar.service.PersionCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class TBankController {

    @Autowired
    private PersionCenterService persionCenterService;

    @GetMapping("/selectAllBank/{userid}")
    public ResultBean selectAllBank(@PathVariable("userid") Integer userid){
        return persionCenterService.selectAllBank(userid);
    }

    //绑定银行卡
    @GetMapping("/bindCard/{userid}/{bankcard}")
    public ResultBean bindCard(@PathVariable("userid")Integer userid,
                               @PathVariable("bankcard")String bankcard){
        return persionCenterService.bindCard(userid,bankcard);
    }

}
